﻿//using System.Collections;
//using System.Collections.Generic;
//using UnityEngine;
//using UnityEngine.UI;


//public class PlayerUIManager : MonoBehaviour,IEventListener {

//    // Use this for initialization
//    private Text PlayerHP;
//    private Text PlayerAttack;
//    private Text PlayerExperience;
//    private Text PlayerLeavel;

//    private int ExperienceValue=0;
//    private int HPValue=10;
//    private int AttackValue = 2;

//	void Start ()
//    {
//        EventNodeCore.GetInstance().AttachEventListener(EventDef.EnemyDie, this);
//        PlayerHP = GameObject.Find("UI/Player/PlayerHP").GetComponent<Text>();
//        PlayerAttack = GameObject.Find("UI/Player/PlayerAttack").GetComponent<Text>();
//        //PlayerExperience = GameObject.Find("UI/Player/Experience/ExperienceValue").GetComponent<Text>();
//        PlayerLeavel = GameObject.Find("UI/Player/PlayerLeavel/LeavelValue").GetComponent<Text>();
//        PlayerHP.text = "HP:" + HPValue;
//        PlayerAttack.text = "Attack:" + AttackValue;
//        ExperienceValue = 10;
//    }
	
//	// Update is called once per frame
//	void Update () {
		
//	}
//    private void OnCollisionEnter(Collision collision)
//    {
//        if (collision.collider.tag == "Treasure")
//        {
//            ObjectPool.GetInstance().Return(collision.collider.gameObject);
//        }
//    }
//    public bool HandleEvent(int id, object param1, object param2)
//    {
//        switch (id)
//        {
//            case EventDef.EnemyDie:
//                Debug.Log("Experi");
//                PlayerExperience.text = ExperienceValue + int.Parse(PlayerExperience.text)+"";
//                LeavelUp(int.Parse(PlayerExperience.text));
//                break;
//        }
//        return false;
//    }

//    public int EventPriority()
//    {
//        return 0;
//    }
//    private void OnDestroy()
//    {
//        EventNodeCore.GetInstance().DetachEventListener(EventDef.EnemyDie, this);
//    }
//    void LeavelUp(int Ex)
//    {
//        if (Ex > 0 && Ex < 30)
//        {
//            PlayerLeavel.text = 1 + "";
//        }
//        else if (Ex > 30 && Ex < 100)
//        {
//            PlayerLeavel.text = 2 + "";
//        }
//    }
//}
